package vn.raz.brainnydefense.object;

public class DamageStage {
	public float x;
	public float y;
	public float vy;
	public float aColor;
	public float time;
	public float basicTime;
	public int numb;
	
	public DamageStage(float x, float y, int numb) {
		this.x = x;
		this.y = y;
		this.vy = 100;
		this.aColor = 0;
		this.time = 0;
		this.numb = numb;
		this.basicTime = .3f;
	}
	
	public void update(float delta){
		time += delta;
		
		if(time<basicTime){
			aColor += delta/basicTime;
			y += vy*delta/(basicTime*3);
		}
		if(time>(basicTime*2))	aColor -= delta/basicTime;
	}
	
	public float getColor(){
		if(aColor>1)	return 1;
		if(aColor<0)	return 0;
		return aColor;
	}
	
	public boolean isTimeUp(){
		return time>(basicTime*3);
	}
	
	public void reset(){
		time = 0;
	}
}
